package com.nercel.dsj.gksales.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 请求映射
 * @author sunlin
 *
 */
@Data
public class RequestMapping {

	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "方法")
	private String method;

	@ApiModelProperty(value = "映射URL")
	private String pattern;

	public String getPatternUrl(){
		return (method + ":" + pattern ).replaceAll("\\{.*?\\}","*");
	}

	public RequestMapping(String name, String method, String pattern) {
		this.name = name;
		this.method = method;
		this.pattern = pattern;
	}

}
